package com.zrt.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zrt.springboot.entity.River;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RiverMapper extends BaseMapper<River> {

    @Insert("insert into graduate_design.sys_river_sensor values (0,#{sensorId},#{depth},#{time})")
    int insert(River river);

    @Select("select depth from graduate_design.sys_river_sensor where sensor_id = #{sensor_id} and time between #{startTime} and #{endTime}")
    List<Double> selectTheData(String sensor_id , String startTime , String endTime);

    @Select("select time from graduate_design.sys_river_sensor where sensor_id = #{sensorId} and time between #{startTime} and #{endTime}")
    List<String> selectTheTime(String sensorId , String startTime , String endTime);
}
